/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.src.uniandes.ecos.tsp.creditscore.base;

import com.src.uniandes.ecos.tsp.creditscore.source.CreditScoreSource;
import java.text.SimpleDateFormat;

/**
 *
 * @author AndhyMao
 */
public class GeneralConstants {

    protected static GeneralConstants instance;
    public static SimpleDateFormat SIMPLE_DATE_FORMAT;
    public static Integer CREDIT_CART_TIP_CODIGO;

    public GeneralConstants() {
        try {
            CreditScoreSource creditScoreSource = CreditScoreSource.getInstance();
            this.SIMPLE_DATE_FORMAT = new SimpleDateFormat(creditScoreSource.getCreditScoreSetupKey("SimpleDateFormat"));
            this.CREDIT_CART_TIP_CODIGO = new Integer(creditScoreSource.getCreditScoreSetupKey("CreditCardTipCodigo"));
        }
        catch (Exception e) {
            this.SIMPLE_DATE_FORMAT = null;
            this.CREDIT_CART_TIP_CODIGO = 1;
        }
    }

    public static GeneralConstants getInstance() {
        if (instance == null) {
            instance = new GeneralConstants();
        }
        return instance;
    }
}
